<html>
<head>
<link href="<?php echo MAIN_URL;?>css/style.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<?php echo MAIN_URL;?>js/submitdetails.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
</head>
<body>

<?php
 
 if($question_details!=""){

?>
  <form name="form2" method="post"  id="fID" >
   <table border="2" cellspacing="1" cellpadding="" align="feft" width="950px" id="tID">
       <tr>
            <td valign="top" bgcolor="white" ><p align="center"><strong>Ques.Id</strong></p></td>
            <td valign="top" bgcolor="white"><p align="center"><strong>Course Id</strong></p></td>
            <td valign="top" bgcolor="white" ><p align="center"><strong>Question</strong></p></td>
            <td valign="top" bgcolor="white"><p align="center"><strong>Answer</strong></p></td>
            <td valign="top" bgcolor="white" ><p align="center"><strong>Staus</strong></p></td>
			<td valign="top" bgcolor="white"><p align="center"><strong>Edit</strong></p></td>
			<td valign="top" bgcolor="white"><p align="center"><strong>Submit</strong></p></td>
		</tr>
<?php
$count = 0;
foreach ($question_details->result() as $row)
            { 
	 echo '<tr>
            <td valign="top" bgcolor="white">'.$row->id.'</td>
			<td valign="top" bgcolor="white">'.$row->courseId.'</td>
            <td valign="top" bgcolor="white" style="width: 200px;">'.$row->question.'</td>
            <td valign="top" bgcolor="white" style="width: 200px;">'.$row->answer.'</td>
			 <td valign="top" bgcolor="white" ><select id='.$count.'>
			 <option value=0>Unapproved</option>
			 <option value=1>Approved</option></select></td>
             <td valign="top" bgcolor="white" ><input type="button" value="Edit" id="editButton" name="editButton" onclick="editRow(this)"></td>
			 <td valign="top" bgcolor="white" ><input type="button" value="Save" id="saveButton" name="saveButton" onclick="saveData(this,'.$count.')" ></td>
         </tr>';
		$count++;
	  }}
	  
	  else echo"<b><h2>No Pending Questions</h2></b>";
	 
	  ?>
	  <br>
	  </table>

 </form>
</body>
 </html>
